package actions.base;

import java.util.Map;

import org.apache.struts2.interceptor.SessionAware;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.opensymphony.xwork2.ActionSupport;

  
public class BaseAction extends ActionSupport implements SessionAware {

	private static final long serialVersionUID = 1L;
	
	protected String SUCCESS_AGREGAR = "success_agregar";
	
	protected static final String SUCCESS_JSON = "success_json";

	protected static final String SUCCESS_LISTADO = "success_listado";

	
	protected String id;
	
	protected String mensaje;
	
	protected String ok;
	
	protected String lista;
	
	private String redirect;
	
	private Map<String,Object> session;
	
	protected void setRedirect(String r){
		this.redirect = r; 
	}
	
	public String getRedirect(){
		
//		 if (this.redirect == null) {
//			return Constants.BUSINESS_VIEW;
//		}
		return this.redirect;
	}

	
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getOk() {
		return ok;
	}

	public void setOk(String ok) {
		this.ok = ok;
	}

	public String getMensaje() {
		return mensaje;
	}

	public void setMensaje(String mensaje) {
		this.mensaje = mensaje;
	}
	
	public String getLista() {
		return lista;
	}

	public void setLista(String lista) {
		this.lista = lista;
	}

	public void setSession(Map<String,Object> session) {
		this.session = session;
	}
	  
	public Map<String,Object> getSession() {
	    return session;
	}

	public Logger getLogger() {
		return LoggerFactory.getLogger(this.getClass());
	}

}